<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <style>
      .scrollTop {
        width: 30px;
        height: 30px;
        display: flex;
        background-color: red;
        color: white;
        justify-content: center;
        align-items: center;
        position: fixed;
        right: 20px;
        bottom: 20px;
        padding: 10px;
        border-radius: 10px;
        cursor: pointer;
        transition: 1s;
        opacity: 0;
      }

      div.show {
        opacity: 1;
        transform: rotate(720deg);
      }
    </style>
    <div style="height: 2000px; background-color: #ddd"></div>
    <div class="scrollTop">TOP</div>

    <script>
      const bt = document.querySelector(".scrollTop");

      //setTimeout(() => bt.classList.add("show"), 1000);
    </script>
  </body>
</html>
